// pages/newproduct/newproduct.js
Page({
  data: {
    evaluationList:[],//获取的评价列表
  },
  // 点击放大图片
  previewImage(e){
    var img = e.currentTarget.dataset.productimg
    wx.previewImage({
      current: img, // 当前显示图片的http链接
      urls: [img] // 需要预览的图片http链接列表
    })
  },
  // 获取评论的信息
  getEvaluation(){
    var that = this
    wx.request({
      url: getApp().globalData.baseUrl + '/wago/saoma/selectpjsl',
      data: {
        status:2
      },
      method: 'POST', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
      
      success: function(res){
        // success
        that.setData({
          evaluationList:res.data.data
        })
        console.log('evaluationList',that.data.evaluationList)
      },
      fail: function() {
        // fail
      },
      complete: function() {
        // complete
      }
    })
  },
  onLoad: function (options) {

  },
  onShow: function () {
    this.getEvaluation()   //获取评论的信息
  },
 
  toNewProduct:function(){
    wx.navigateTo({
      url: '/pages/newproduct/newproduct'
    })
  },
  toNew:function(){
    wx.navigateTo({
      url: '/pages/whetherEvaluate/whetherEvaluate'
    })
  }
})